home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / makefile.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  6KB  |  196 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Paolo Borelli <pborelli@katamail.com>
  5.  Copyright (C) 2005 Paolo Borelli <pborelli@katamail.com>
  6.  Copyright (C) 2005 Ricardo Lenz
  7.  
  8.  This library is free software; you can redistribute it and/or
  9.  modify it under the terms of the GNU Library General Public
  10.  License as published by the Free Software Foundation; either
  11.  version 2 of the License, or (at your option) any later version.
  12.  
  13.  This library is distributed in the hope that it will be useful,
  14.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  Library General Public License for more details.
  17.  
  18.  You should have received a copy of the GNU Library General Public
  19.  License along with this library; if not, write to the
  20.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  Boston, MA 02111-1307, USA.
  22.  
  23. -->
  24. <language id="makefile" _name="Makefile" version="2.0" _section="Sources">
  25.   <metadata>
  26.     <property name="mimetypes">text/x-makefile</property>
  27.     <property name="globs">[Mm]akefile;GNUmakefile;[Mm]akefile.*;*.make;*.mk</property>
  28.     <property name="line-comment-start">#</property>
  29.   </metadata>
  30.  
  31.   <styles>
  32.     <style id="variable"        _name="Variable" map-to="def:type"/>
  33.     <style id="assignment-rhs"  _name="Assignment Right Hand Side"/>
  34.     <style id="assignment-lhs"  _name="Assignment Left Hand Side"/>
  35.     <style id="targets"         _name="targets" map-to="def:function"/>
  36.     <style id="prereq"          _name="prereq"/>
  37.     <style id="command"         _name="command"/>
  38.     <!-- Translators: Trailing Tabs refers to tabulation characters present at
  39.          the end of the line -->
  40.     <style id="trailing-tab"    _name="Trailing Tab"/>
  41.     <style id="function"        _name="function" map-to="def:function"/>
  42.     <style id="keyword"         _name="keyword" map-to="def:keyword"/>
  43.   </styles>
  44.  
  45.   <definitions>
  46.     <define-regex id="variable">[a-zA-Z_][a-zA-Z0-9_]*</define-regex>
  47.  
  48.     <context id="variable-1">
  49.       <match>\$\((\%{variable})\)</match>
  50.       <include>
  51.         <context sub-pattern="1" style-ref="variable"/>
  52.       </include>
  53.     </context>
  54.  
  55.     <context id="variable-2">
  56.       <match>\$\{(\%{variable})\}</match>
  57.       <include>
  58.         <context sub-pattern="1" style-ref="variable"/>
  59.       </include>
  60.     </context>
  61.  
  62.     <context id="variable">
  63.       <include>
  64.         <context ref="variable-1"/>
  65.         <context ref="variable-2"/>
  66.       </include>
  67.     </context>
  68.  
  69.     <context id="backtick-string" style-ref="function" end-at-line-end="true">
  70.       <start>`</start>
  71.       <end>`</end>
  72.       <include>
  73.         <context ref="def:escape"/>
  74.         <context ref="def:line-continue"/>
  75.       </include>
  76.     </context>
  77.  
  78.     <context id="string">
  79.       <include>
  80.     <!-- skip escaped characters -->
  81.         <context>
  82.           <match>\\.</match>
  83.         </context>
  84.         <context ref="def:string"/>
  85.       </include>
  86.     </context>
  87.  
  88.     <context id="assignment-rhs" style-ref="assignment-rhs" end-at-line-end="true">
  89.       <start></start>
  90.       <include>
  91.         <context ref="def:line-continue"/>
  92.         <context ref="def:shell-like-comment"/>
  93.         <context ref="variable"/>
  94.         <context ref="string"/>
  95.         <context ref="def:single-quoted-string"/>
  96.         <context ref="backtick-string"/>
  97.       </include>
  98.     </context>
  99.  
  100.     <context id="command" style-ref="command" extend-parent="false" end-at-line-end="true">
  101.       <start></start>
  102.       <include>
  103.         <context ref="def:line-continue"/>
  104.         <context ref="def:shell-like-comment"/>
  105.         <context ref="variable"/>
  106.         <context ref="string"/>
  107.         <context ref="def:single-quoted-string"/>
  108.         <context ref="backtick-string"/>
  109.       </include>
  110.     </context>
  111.  
  112.     <context id="directives" style-ref="keyword">
  113.       <keyword>define</keyword>
  114.       <keyword>else</keyword>
  115.       <keyword>endef</keyword>
  116.       <keyword>endif</keyword>
  117.       <keyword>if</keyword>
  118.       <keyword>ifdef</keyword>
  119.       <keyword>ifeq</keyword>
  120.       <keyword>ifndef</keyword>
  121.       <keyword>ifneq</keyword>
  122.       <keyword>include</keyword>
  123.       <keyword>override</keyword>
  124.       <keyword>unexport</keyword>
  125.     </context>
  126.  
  127.     <context id="functions" style-ref="function">
  128.       <keyword>addprefix</keyword>
  129.       <keyword>addsuffix</keyword>
  130.       <keyword>basename</keyword>
  131.       <keyword>call</keyword>
  132.       <keyword>dir</keyword>
  133.       <keyword>error</keyword>
  134.       <keyword>filter</keyword>
  135.       <keyword>filter-out</keyword>
  136.       <keyword>findstring</keyword>
  137.       <keyword>firstword</keyword>
  138.       <keyword>foreach</keyword>
  139.       <keyword>join</keyword>
  140.       <keyword>notdir</keyword>
  141.       <keyword>origin</keyword>
  142.       <keyword>patsubst</keyword>
  143.       <keyword>shell</keyword>
  144.       <keyword>sort</keyword>
  145.       <keyword>strip</keyword>
  146.       <keyword>subst</keyword>
  147.       <keyword>suffix</keyword>
  148.       <keyword>warning</keyword>
  149.       <keyword>wildcard</keyword>
  150.       <keyword>word</keyword>
  151.       <keyword>words</keyword>
  152.     </context>
  153.  
  154.     <context id="makefile">
  155.       <include>
  156.         <context ref="def:shebang"/>
  157.         <context ref="def:shell-like-comment"/>
  158.  
  159.         <context id="assignment" end-at-line-end="true">
  160.           <start>^(\%{variable})\s*[\+]?=</start>
  161.             <include>
  162.               <context sub-pattern="1" where="start" style-ref="assignment-lhs"/>
  163.               <context ref="assignment-rhs"/>
  164.             </include>
  165.         </context>
  166.  
  167.         <context id="rule">
  168.           <start>^([^\t\:][^\:]*)\:</start>
  169.           <end>^(?!\t)</end>
  170.           <include>
  171.             <context sub-pattern="1" where="start" style-ref="targets"/>
  172.             <context id="prereq" end-at-line-end="true" style-ref="prereq">
  173.               <start>(?<=:)(?=.)</start>
  174.               <end>;</end>
  175.               <include>
  176.                 <context ref="def:escape"/>
  177.                 <context ref="def:line-continue"/>
  178.                 <context ref="variable"/>
  179.                 <context ref="functions"/>
  180.               </include>
  181.             </context>
  182.             <context id="trailing-tab" style-ref="trailing-tab">
  183.               <match>^\t+$</match>
  184.             </context>
  185.             <context ref="command"/>
  186.           </include>
  187.         </context>
  188.  
  189.         <context ref="directives"/>
  190.         <context ref="functions"/>
  191.  
  192.       </include>
  193.     </context>
  194.   </definitions>
  195. </language>
  196.